home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
CUGUK
/
PC_LIBS
/
C045.ZIP
/
BTREE.ARC
/
ACCESS.H
next >
Wrap
C/C++ Source or Header
|
1989-02-08
|
3KB
|
93 lines
char * getrec (datafile * dfp, int recno, char * buff);
/*
* Get the recno record of the datafile *dfp and place the record
* where buff points to. Getrec returns this same pointer value.
*/
int putrec (datafile * dfp, int recno, char * buff);
/*
* Write the record pointed to by buff as record number recno
* to the datafile *dfp. Return the value 1 is successful.
*/
datafile * makefile (char * fname, int recsize);
/*
* Make a file, fname, to have record size equal to recsize.
*/
datafile * openfile (char *);
void closefile (datafile *);
int newrec (datafile * dfp);
/*
* Get a new record. Return the record number of this new record.
*/
int addrec (datafile * dfp, char * buff);
/*
* Add the data pointed to by buff as a new record to the
* datafile * dfp. Return the record number of this new record.
*/
void deleterec (datafile * dfp, int recno);
/*
* delete the data item with record number recno from the
* datafile *dfp.
*/
int usedrecs (datafile * dfp);
/*
* Return the number of active record of the datafile * dfp.
*/
void initindex (void);
/*
* initialize the stack for the index pages.
*/
void tapack (tapagerec * ppagrec);
void taunpack (tapagerec * ppagrec);
/*
* When writing a page to disk, we do a little packing to conserve
* disk space. Conversely, we must do a little unpacking when we
* an index page from disk.
*/
indexfile * makeindex (char * fname, int keylength, int dupsallowed);
/*
* Make an indexfile named fname with key length keylength and
* duplicates will be allowed if dupsallowed is not zero.
* Return a pointer to the indexfile if successful, else NULL.
*/
indexfile * openindex (char * fname);
void closeindex (indexfile * fname);
void talast (int i);
/*
* talast makes the ith page on the pagerec stack the most
* recently accessed page.
*/
tapagerec * tagetpage (indexfile * dfp, int pageref);
/*
* Read a page from disk, if necessary, to the page stack. The record
* number of the page is pageref associated with the indexfile * dfp.
* Return a pointer to where the page is on the stack.
*/
tapagerec * tanewpage (indexfile * nfp);
/*
* Find space on the page stack and initialize a new page to be
* associated with the indexfile *nfp. Return a pointer to where
* the page is on the stack.
*/
void tareturnpage (tapage * pageptr);
/*
* delete the page pointed by the page pointer pageptr.
*/
void taxkey (char * key, int keylen);
/*
* Chop off the key if it is longer than keylen.
*/
int tacompkeys (char * key1, char * key2,
int datref1, int datref2, int dupsallowed);
/*
* Compare two keys. Return the strcmp() value if not equal.
* If equal then
* if dups are allowed
* return datref1 - datref2
* Otherwise
* return 0.
*/
void clearkey (indexfile * nfp);
/*
* initialize the search path to no current path for the indexfile *nfp.
*/